<template>
  <div>
    <p>你要购买商品的数量: {{ count }}</p>
    <button v-on:click="count += 1">+1</button>
    <button v-on:click="count -= 1">-1</button>
    <button v-on:click="addfns">+1</button>
    <button v-on:click="addsum(10)">+10</button>
    <button @click="addvisbut(10)">-10</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 1,
    };
  },
  methods: {
    addfns() {
      this.count += 1;
    },
    addsum(num) {
      this.count += num;
    },
    addvisbut(sum) {
      this.count -= sum;
    },
  },
};
</script>

<style>
</style>